package com.gxa.j259.springcloud.f.zipkin.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author thinknovo
 * @version 1.0
 */
@RestController
public class ServiceZipkinOneController {
    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/whoAreYou")
    public String whoAreYou(){
        System.out.println("ServiceZipkinOneController  ---01---  whoAreYou");
        // 这里调用另外一个模块的接口
        return restTemplate.getForObject("http://localhost:9562/getUsername", String.class);
    }

    @RequestMapping("/getUsername")
    public String getUsername(){
        System.out.println("ServiceZipkinOneApplication  ---01---  getUsername");
        return "You Are Pig...";
    }
}
